home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / zbpc_460.zip / DEMOS.EXE / DAYOFWK.BAS next >
BASIC Source File  |  1991-04-10  |  640b  |  19 lines

  1. ' DAY-WK = Calculates the day of the week given date
  2.  
  3. DIM Days$(6): FOR I=0 TO 6: READ Days$(I): NEXT
  4. CLS :PRINT
  5. PRINT"   This routine calculates the day of the week given the date" : PRINT
  6.  
  7. INPUT "Enter date as dd/mm/yyyy        ";Date$
  8. X$ = LEFT$(Date$,2) : Month =  VAL(X$)
  9. X$ = MID$(Date$,4,2) : Day = VAL(X$)
  10. X$ = RIGHT$(Date$,4) : Year = VAL(X$)
  11.  
  12. IF Month > 2 GOTO "Bypass"
  13. Month=Month+12 : Year=Year-1
  14. "Bypass"
  15. N=Day+2*Month+INT(.6*(Month+1))+Year+INT(Year/4)-INT(Year/100)+INT(Year/400)+ 2
  16. N=INT((N/7-INT(N/7))*7+.5)
  17. PRINT Days$(N)
  18. DATA Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday
  19.